package com.moore.mapper;

import com.moore.bean.Area;
import com.moore.bean.City;
import com.moore.bean.Province;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface AreaMapper {

    List<Province> getProvince(@Param("province") String province);

    List<City> getCity(@Param("province") String province, @Param("city") String city);

    List<Area> getArea(@Param("province") String province, @Param("city") String city, @Param("area") String area, @Param("size") int size, @Param("curr") int curr);

    int getAreaCount(@Param("province") String province, @Param("city") String city, @Param("area") String area);

    int addProvince(@Param("province") String province);

    int addCity(@Param("province") String province, @Param("city") String city);

    int addArea(@Param("province") String province, @Param("city") String city, @Param("area") String area, @Param("remarks") String remarks);

    int updateArea(@Param("area") Area area);

    @MapKey("value = area")
    List<Map<String, Object>> getCommunityCounts(@Param("areas") List<String> areas);

}
